@using BlazorApp.Pages.Common
@using BlazorApp.Pages.Common.Html.HTable
@using BlazorApp.Pages.Common.Metadata
@using BlazorApp.Pages.Event
@using BlazorApp.Pages.Pod
@inherits BlazorApp.Pages.Common.DrawerPageBase<k8s.Models.V1PodDisruptionBudget>
@if (PodDisruptionBudget != null)
{
    <PodDisruptionBudgetAction Item="PodDisruptionBudget" MenuMode="MenuMode.Horizontal"></PodDisruptionBudgetAction>
    <Divider Orientation="left" Style="font-weight:bold">@L["Metadata"]</Divider>
    <MetadataView Item="PodDisruptionBudget.Metadata" ExplainFieldPrefix="podDisruptionBudget"></MetadataView>
    <Divider Orientation="left" Style="font-weight:bold">@L["Spec"]</Divider>
    <HTable Bordered Column="1">
        <PropertySimpleView Title=@L["MaxUnavailable"] Item="@PodDisruptionBudget.Spec.MaxUnavailable"
                            ExplainField="podDisruptionBudget.spec.maxUnavailable"
                            ShowInJson="true">
        </PropertySimpleView>
        <PropertySimpleView Title=@L["MinAvailable"] Item="@PodDisruptionBudget.Spec.MinAvailable"
                            ExplainField="podDisruptionBudget.spec.minAvailable" ShowInJson="true">
        </PropertySimpleView>
        <LabelSelectorView Title=@L["Selector"] LabelSelector="@PodDisruptionBudget.Spec.Selector" ExplainField="podDisruptionBudget.spec.selector"></LabelSelectorView>
        <PropertyOptionView Title=@L["UnhealthyPodEvictionPolicy"]
                            Item="@PodDisruptionBudget.Spec.UnhealthyPodEvictionPolicy"
                            ExplainField="podDisruptionBudget.spec.unhealthyPodEvictionPolicy"
                            Options="@(new[] { "AlwaysAllow", "IfHealthyBudget" })">
        </PropertyOptionView>
    </HTable>
    <Divider Orientation="left" Style="font-weight:bold">@L["Status"]</Divider>
    <HTable Bordered Column="1">
        <ConditionsView Conditions="@PodDisruptionBudget.Status.Conditions" ExplainField="podDisruptionBudget.status.conditions"></ConditionsView>
        <PropertySimpleView Title=@L["CurrentHealthy"] Item="@PodDisruptionBudget.Status.CurrentHealthy"
                            ExplainField="podDisruptionBudget.status.currentHealthy">
        </PropertySimpleView>
        <PropertySimpleView Title=@L["DesiredHealthy"] Item="@PodDisruptionBudget.Status.DesiredHealthy"
                            ExplainField="podDisruptionBudget.status.desiredHealthy">
        </PropertySimpleView>
        <PropertySimpleView Title=@L["DisruptedPods"] Item="@PodDisruptionBudget.Status.DisruptedPods"
                            ExplainField="podDisruptionBudget.status.disruptedPods"
                            ShowInJson="true">
        </PropertySimpleView>
        <PropertySimpleView Title=@L["DisruptionsAllowed"] Item="@PodDisruptionBudget.Status.DisruptionsAllowed"
                            ExplainField="podDisruptionBudget.status.disruptionsAllowed">
        </PropertySimpleView>
        <PropertySimpleView Title=@L["ExpectedPods"] Item="@PodDisruptionBudget.Status.ExpectedPods"
                            ExplainField="podDisruptionBudget.status.expectedPods">
        </PropertySimpleView>
        <PropertySimpleView Title=@L["ObservedGeneration"] Item="@PodDisruptionBudget.Status.ObservedGeneration"
                            ExplainField="podDisruptionBudget.status.observedGeneration">
        </PropertySimpleView>
    </HTable>

    <MiniPodListView Pods="PodList"></MiniPodListView>

    <MiniEventListView Uid="@PodDisruptionBudget.Metadata.Uid"></MiniEventListView>
}
